package com.ssy.lingxi.order.model.bo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Objects;

/**
 * 调用商品服务扣减、返还库存接口参数
 * @author 万宁
 * @version 2.0.0
 * @date 2021-08-12
 */
public class InventoryProductBO implements Serializable {
    private static final long serialVersionUID = -4754229211662846241L;

    public InventoryProductBO(Long productId, Long skuId, Long stockId, String productName, BigDecimal quantity) {
        this.productId = productId;
        this.skuId = skuId;
        this.stockId = stockId;
        this.productName = productName;
        this.quantity = quantity;
    }

    /**
     * 会员商品Id
     */
    private Long productId;

    /**
     * 会员商品SkuId
     */
    private Long skuId;

    /**
     * 渠道商品Id
     */
    private Long stockId;

    /**
     * 商品名称
     */
    private String productName;

    /**
     * 扣减、返还的数量
     */
    private BigDecimal quantity;

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public Long getStockId() {
        return stockId;
    }

    public void setStockId(Long stockId) {
        this.stockId = stockId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public BigDecimal getQuantity() {
        return quantity;
    }

    public void setQuantity(BigDecimal quantity) {
        this.quantity = quantity;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        InventoryProductBO that = (InventoryProductBO) o;
        return productId.equals(that.productId) &&
                skuId.equals(that.skuId) &&
                stockId.equals(that.stockId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(productId, skuId, stockId);
    }
}
